package net.monkeybros.sbus.model;

import com.neurospeech.wsclient.*;
import org.w3c.dom.*;

public class InfoCoche extends WSObject
{
	
	private Integer _coche;
	public Integer getcoche(){
		return _coche;
	}
	public void setcoche(Integer value){
		_coche = value;
	}
	private Integer _vehiculo;
	public Integer getvehiculo(){
		return _vehiculo;
	}
	public void setvehiculo(Integer value){
		_vehiculo = value;
	}
	private String _serv_bus;
	public String getserv_bus(){
		return _serv_bus;
	}
	public void setserv_bus(String value){
		_serv_bus = value;
	}
	private Integer _conductor;
	public Integer getconductor(){
		return _conductor;
	}
	public void setconductor(Integer value){
		_conductor = value;
	}
	private String _serv_cond;
	public String getserv_cond(){
		return _serv_cond;
	}
	public void setserv_cond(String value){
		_serv_cond = value;
	}
	private Integer _estado;
	public Integer getestado(){
		return _estado;
	}
	public void setestado(Integer value){
		_estado = value;
	}
	private Integer _estadoLocReal;
	public Integer getestadoLocReal(){
		return _estadoLocReal;
	}
	public void setestadoLocReal(Integer value){
		_estadoLocReal = value;
	}
	private InfoPosicion _pos_real;
	public InfoPosicion getpos_real(){
		return _pos_real;
	}
	public void setpos_real(InfoPosicion value){
		_pos_real = value;
	}
	private InfoPosicion _pos_teor;
	public InfoPosicion getpos_teor(){
		return _pos_teor;
	}
	public void setpos_teor(InfoPosicion value){
		_pos_teor = value;
	}
	private InfoSeparacion _desfase;
	public InfoSeparacion getdesfase(){
		return _desfase;
	}
	public void setdesfase(InfoSeparacion value){
		_desfase = value;
	}
	private InfoSeparacion _frec_real;
	public InfoSeparacion getfrec_real(){
		return _frec_real;
	}
	public void setfrec_real(InfoSeparacion value){
		_frec_real = value;
	}
	
	public static InfoCoche loadFrom(Element root) throws Exception
	{
		if(root==null){
			return null;
		}
		InfoCoche result = new InfoCoche();
		result.load(root);
		return result;
	}
	
	
	protected void load(Element root) throws Exception
	{
		this.setcoche(WSHelper.getInteger(root,"coche",false));
		this.setvehiculo(WSHelper.getInteger(root,"vehiculo",false));
		this.setserv_bus(WSHelper.getString(root,"serv_bus",false));
		this.setconductor(WSHelper.getInteger(root,"conductor",false));
		this.setserv_cond(WSHelper.getString(root,"serv_cond",false));
		this.setestado(WSHelper.getInteger(root,"estado",false));
		this.setestadoLocReal(WSHelper.getInteger(root,"estadoLocReal",false));
		this.setpos_real(InfoPosicion.loadFrom(WSHelper.getElement(root,"pos_real")));
		this.setpos_teor(InfoPosicion.loadFrom(WSHelper.getElement(root,"pos_teor")));
		this.setdesfase(InfoSeparacion.loadFrom(WSHelper.getElement(root,"desfase")));
		this.setfrec_real(InfoSeparacion.loadFrom(WSHelper.getElement(root,"frec_real")));
	}
	
	
	
	public Element toXMLElement(Element root)
	{
		Element e = root.getOwnerDocument().createElement("InfoCoche");
		fillXML(e);
		return e;
	}
	
	public void fillXML(Element e)
	{
		WSHelper.addChild(e,"coche",String.valueOf(_coche),false);
		WSHelper.addChild(e,"vehiculo",String.valueOf(_vehiculo),false);
		if(_serv_bus!=null)
			WSHelper.addChild(e,"serv_bus",String.valueOf(_serv_bus),false);
		WSHelper.addChild(e,"conductor",String.valueOf(_conductor),false);
		if(_serv_cond!=null)
			WSHelper.addChild(e,"serv_cond",String.valueOf(_serv_cond),false);
		WSHelper.addChild(e,"estado",String.valueOf(_estado),false);
		WSHelper.addChild(e,"estadoLocReal",String.valueOf(_estadoLocReal),false);
		if(_pos_real!=null)
			WSHelper.addChildNode(e, "pos_real",_pos_real.toXMLElement(e),null);
		if(_pos_teor!=null)
			WSHelper.addChildNode(e, "pos_teor",_pos_teor.toXMLElement(e),null);
		if(_desfase!=null)
			WSHelper.addChildNode(e, "desfase",_desfase.toXMLElement(e),null);
		if(_frec_real!=null)
			WSHelper.addChildNode(e, "frec_real",_frec_real.toXMLElement(e),null);
	}
	
}
